import React,{ Component } from 'react';
import './radio.scss';


class RadioOne extends Component{
	render(){
		return(
			<div id="radio-one" className="flex">
				{this.props.data.map(item => {
					let select = '';
					if (item.id === this.props.value) {
						select = 'select';
					}
					return <div className="flex-center flex-g-1 radio-item"  key={item.id} onClick={()=>{this.props.onChange(item.id);}}>
						<div className={ `${select} cap` } ></div>
						<div className="pay-name">{item.name}</div>
					</div>;
				})}
			</div>
		);
	}
}

export default RadioOne;
